<?php
/**
 * 行政区域Model
 * Created by PhpStorm.
 * User: geyouwen
 * Date: 16/8/4
 * Time: 下午2:39
 */

namespace Backend\Model;


use Think\Model;

class AreaModel extends Model
{

    protected $connection = 'DB_CONFIG1';

    protected $table      = 'area';

    protected $prefix     = 'tp_';


    //获取children数据

    public function getChildren($pid, $order = 'ordid asc')
    {
        $data = $this->where(array('pid' => $pid, 'status' => 1))
                ->field('id,pid,name')
                ->order($order)
                ->select();
        return $data;
    }

}